package com.tgy.greedy;

import lombok.Data;

/**
 * @Author: tgy
 * @Date: 2020-11-04 17:48
 */
@Data
public class Goods {

    /**
     * 重量
     */
    private int weight;
    /**
     * 价值
     */
    private int value;

    private double valueDensity;

    public Goods(int weight, int value) {
        this.weight = weight;
        this.value = value;
        this.valueDensity = (value * 1.0) / weight;
    }
}
